#ifndef _KLAS_UI_ELEMENT_HPP_
#define _KLAS_UI_ELEMENT_HPP_

#include "../graphics/Renderable.hpp"
#include "../math/Vector2.hpp"
#include "../math/Rectangle.hpp"
#include "../graphics/Sprite.hpp"
#include <vector>
#include <string>
using std::vector;
using std::string;

namespace klas
{
	namespace gui
	{
    class KLAS_API UIElement : public graphics::Sprite
		{
		public:
      enum Behavior {none, fade, risedrop};
      enum Type {button, scrollpane, menubar, panel};
			
      virtual void update() = 0;

      void renderAt(math::Vector2d& pos);

    private:
			//! Takes the name of the 
      UIElement(string filename, math::Rectd& bounds, UIElement* parent = NULL, 
						Behavior behave = none);
			
			UIElement(const UIElement& element);

			//! The UIElement in which this one resides. If it is set
			//! to NULL, then it has no parent.
			UIElement* m_UIParent;

			//! The list of children inside this UIElement;
			vector<UIElement*> m_UIChildren;

			//! The position of this object in relation to its parent.
      math::Vector2d m_position;

			//! The appearance/disappearing behavoir of this UIElement
			Behavior m_behavior;

			//! The boundary of this UIElement
      math::Rectd m_bbox;

			//! The heading of this UIElement, displayed c
			string m_heading;

			//! The type of UIElement this object is. It can
			Type m_type;

			//! Makes the UIElement appear with the specified behavior
			void appear();

			//! Causes the UIElement to disappear with the specified behavoir
			void hide();
		};
	}
}

#endif